<header id="topbar" class="">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="<%= window.location.href %>">上分通道管理</a>
            </li>
        </ol>
    </div>
    <div class="topbar-right">
        <a href="#op/channel/add/" class="btn btn-default btn-sm light fw600 ml10"><span class="fa fa-plus pr5"></span>新建通道</a>
        <div class="ml15 ib va-m" id="toggle_sidemenu_r">
            <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
            </a>
        </div>
    </div>
</header>

<section id="content" class="animated fadeIn">
    <div class="panel overflow" >
        <table class="table table-striped fs13" id="main-list">
            <thead>
                <tr class="bg-light">
                    <th class="sortable" data-field="id">ID</th>
                    <th class="sortable" data-field="name">名称</th>
                    <th>关联商户</th>
                    <th>通道等级</th>
                    <th>支付分类</th>
                    <th>通道类型</th>
                    <th>唤起支付方式</th>
                    <th>状态</th>
                    <th class="sortable" data-field="updated_at">最后更新时间</th>
                    <th class="">创建时间</th>
                    <th class="">操作</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% _.each(items, function(item){
                %>
                    <tr data-id="<%= item.id %>" >
                        <td class=""><a href="#op/channel/<%= item.id %>/" ><%= item.id %></a></td>
                        <td class=""><%= item.name %></td>
                        <td class=""><%= item.mch_id %></td>
                        <td class=""><%= item.level %></td>
                        <td class=""><%= item.service_name %></td>
                        <td><%= CHANNEL_TYPE[item.chn_type] %></td>
                        <td class=""><%= item.open_type %></td>
                        <td class=""><%= item.status == 0 ? '不可用' : '可用' %></td>
                        <td class=""><%= item.updated_at %></td>
                        <td><%= item.created_at ? item.created_at : "-" %></td>
                        <td class="text-left">
                            <a class="glyphicons glyphicons-pencil" href="#op/channel/<%= item.id %>/"></a>
                            <a class="glyphicons glyphicons-remove_2 onClickDelete" href="javascript:;"></a>
                        </td>
                    </tr>
                <%
                }) %>
            </tbody>
        </table>
    </div>
    <div><div class="pull-left" id="page-tips"></div><div id="paginator"></div></div>
</section>

<!-- Start: Right Sidebar -->
<aside id="sidebar_right" class="nano">
                <h4 class="mt5 text-muted fw500">过滤条件</h4>
                <hr class="short">
                <div class="p20 admin-form">
                    <div class="section mb15">
                        <label for="searchId" class="field prepend-icon">
                            <input title="ID" type="text" data-field="id" id="searchId" class="gui-input" placeholder="ID" value="<%= searched.id  %>">
                            <label for="searchId" class="field-icon"><i class="fa fa-tag"></i>
                            </label>
                        </label>
                    </div>
                    <div class="section mb15">
                        <label for="searchName" class="field prepend-icon">
                            <input title="通道名称" type="text" data-field="name" id="searchName" class="gui-input" placeholder="通道名称" value="<%= searched.name  %>">
                            <label for="searchName" class="field-icon"><i class="fa fa-tag"></i>
                            </label>
                        </label>
                    </div>
                    <h6 class="fw400">商户编号</h6>
                    <div class="section mb15">
                        <label class="field select">
                            <select id="searchMchId" name="searchMchId" data-field="mch_id">
                                <option value="-1" <%= searched.mch_id == -1 ? 'selected' : '' %>>所有</option>
                                <% _.each(mchs, function(mch){ %>
                                    <option value="<%= mch.id %>" <%= searched.mch_id == mch.id ? 'selected' : '' %>><%= mch.name %>(<%= mch.id %>)</option>
                                <% }) %>
                            </select>
                            <i class="arrow double"></i>
                        </label>
                    </div>
                    <h6 class="fw400">支付分类</h6>
                    <div class="section mb15">
                        <label class="field select">
                            <select id="searchServiceName" name="searchServiceName" data-field="service_name">
                                <option value="-1" <%= searched.service_name == -1 ? 'selected' : '' %>>所有</option>
                                <% _.each(SERVICE_NAME, function(k){%>
                                    <option value="<%= k %>" <%= searched.service_name == k ? 'selected': 0 %>><%= k %></option>
                                <% }) %>
                            </select>
                            <i class="arrow double"></i>
                        </label>
                    </div>
                    <h6 class="fw400">通道类型</h6>
                    <div class="section mb15">
                        <label class="field select">
                            <select id="searchChannelType" name="searchChannelType" data-field="chn_type">
                                <option value="-1" <%= searched.chn_type == -1 ? 'selected' : '' %>>所有</option>
                                <% _.each(CHANNEL_TYPE, function(v, k){%>
                                    <option value="<%= k %>" <%= searched.chn_type == k ? 'selected': 0 %>><%= v %></option>
                                <% }) %>
                            </select>
                            <i class="arrow double"></i>
                        </label>
                    </div>
                    <h6 class="fw400">状态</h6>
                    <div class="section mb15">
                        <label class="field select">
                            <select id="searchStatus" name="searchStatus" data-field="status">
                                <option value="-1" <%= searched.status == -1 ? 'selected' : '' %>>所有</option>
                                <% _.each(CHANNEL_STATUS, function(v, k){%>
                                    <option value="<%= k %>" <%= searched.status == k ? 'selected': 0%>><%= v %></option>
                                <% }) %>
                            </select>
                            <i class="arrow double"></i>
                        </label>
                    </div>
                    <hr class="short">

                    <button class="btn btn-default btn-block" type="button" id="search">搜索</button>

                </div>

</aside>
<!-- End: Right Sidebar -->
